package org.applet.game.app.rpg.resource;

import java.awt.image.BufferedImage;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

import org.applet.game.framework.util.ImageLoader;

public class SpriteResource {

	public static final String SpritePath = "image/role/";
	public static final String SpriteBodyPath = "image/role/body/";
	public static final String SpriteWeaponPath = "image/role/weapon/";
	
	public static Properties loadBodyConfig(String spriteName)
	{
		Properties properties = new Properties();
		try {
			FileInputStream is = new FileInputStream(SpriteBodyPath+spriteName+"/config.ini");
			properties.load(is);
			is.close();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		return properties;
	}
	
	public static BufferedImage loadBodyImage(String bodyNumber, int index1, int index2)
	{
		return ImageLoader.loadImage(SpriteBodyPath+bodyNumber+"/"+index1+"-"+index2+".png");
	}
	
}
